﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Rage.Mercenary
{
    public class ComparisonCalculationMercenary : ComparisonCalculationBase
    {
        private string _name = string.Empty;
        public override string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        private string _desc = string.Empty;
        public override string Description
        {
            get { return _desc; }
            set { _desc = value; }
        }

        private float _overallPoints = 0f;
        private float[] _subPoints = new float[] { 0f, 0f, 0f, 0f };
        public override float[] SubPoints
        {
            get { return _subPoints; }
            set { _subPoints = value; }
        }
        public float MercenaryDpsPoints
        {
            get { return _subPoints[(int)subpointINDEX.MERCDPS]; }
            set { _subPoints[(int)subpointINDEX.MERCDPS] = value; }
        }
        public float MercenarySurvPoints
        {
            get { return _subPoints[(int)subpointINDEX.MERCSURVIVAL]; }
            set { _subPoints[(int)subpointINDEX.MERCSURVIVAL] = value; }
        }
        public override float OverallPoints
        {
            get
            {
                _overallPoints = 0;
                _overallPoints += MercenaryDpsPoints;
                _overallPoints += MercenarySurvPoints;
                return _overallPoints;
            }
            set { _overallPoints = value; }
        }

        private Item _item = null;
        public override Item Item
        {
            get { return _item; }
            set { _item = value; }
        }

        private ItemInstance _itemInstance = null;
        public override ItemInstance ItemInstance
        {
            get { return _itemInstance; }
            set { _itemInstance = value; }
        }

        private bool _equipped = false;
        public override bool Equipped
        {
            get { return _equipped; }
            set { _equipped = value; }
        }

        public override bool PartEquipped { get; set; }

        public override string ToString() {
            return string.Format("{0}: ({1:0.###} Overall = {2:0.###} DPS + {3:0.###} Surv)",
                Name, Math.Round(OverallPoints), Math.Round(MercenaryDpsPoints ), Math.Round(MercenarySurvPoints));
        }
    }
}
